FROM hub.c.163.com/library/node:latest

EXPOSE 8002 2001 3005 3150 3250 3350 4150 4250 4350 4450

# check every 30s to ensure this service returns HTTP 200
HEALTHCHECK CMD curl -fs http://localhost:8002/healthz || exit 1

WORKDIR /opt/app/game-server
COPY package.json package-lock.json* ./
RUN npm install && npm cache clean --force && npm install -g forever
ENV PATH /opt/app/game-server/node_modules/.bin:$PATH

COPY . /opt/app/game-server
RUN mkdir logs
VOLUME /opt/app/game-server/logs

ENTRYPOINT [ "forever", "app.js" ]



